package theeg.DependencyAnalysis.Core;

import theeg.DependencyAnalysis.Core.DataModel.MemberDescriptor;
import theeg.DependencyAnalysis.Core.DataModel.ModuleDescriptor;
import theeg.DependencyAnalysis.Core.DataModel.SubmoduleDescriptor;
import theeg.DependencyAnalysis.Core.DataModel.TypeDescriptor;

import java.util.function.Function;

public final class Filters {

    private Filters() {}

    public static final Function<ModuleDescriptor, Boolean> MyModules =
    x -> x.isPartOfProject();

    public static final Function<SubmoduleDescriptor, Boolean> MySubmodules =
    x -> x.getModule().isPartOfProject();

    public static final Function<TypeDescriptor, Boolean> MyTypes =
    x -> !x.isGenerated() && x.getSubmodule().getModule().isPartOfProject();

    public static final Function<MemberDescriptor, Boolean> MyMembers =
    x -> !x.isGenerated() && x.getImplementingType().getSubmodule().getModule().isPartOfProject();
}
